package com.jinbiao.jdbc;

import java.sql.ResultSet;
import java.sql.SQLException;
import org.springframework.jdbc.core.RowMapper;
/**
 * 实现java 到  数据库的映射关系
 * 
 * @author EX_WLJR_ZHUANGJB
 *
 */
public class StudentMapper  implements RowMapper<Student >{

	public Student mapRow(ResultSet rs, int rowNum) throws SQLException {
		 Student student = new Student();
	      student.setId(rs.getInt("id"));
	      student.setName(rs.getString("name"));
	      student.setAge(rs.getInt("age"));
	      return student;
	}

}
